package ffhs.lernkartei.domain;

import java.io.Serializable;
import java.util.Date;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Card Domain Objekt.
 * 
 * @author schwendh
 * 
 */
@DatabaseTable
public class Card implements Serializable
{
	// Serial ID
	private static final long serialVersionUID = -9190519796375787525L;
	// Globale public Konstanten
	public static final String FRONT_FIELD_NAME = "front";
	public static final String BACK_FIELD_NAME = "back";
	public static final String STACKID_FIELD_NAME = "stack_id";
	public static final String CREATEDATE_FIELD_NAME = "create_date";
	public static final String REPEATDATE_FIELD_NAME = "repeat_date";
	public static final String NEWCARD_FIELD_NAME = "new_card";
	public static final String INTERVALL_FIELD_NAME = "intervall";
	public static final String FREEMODEANSWEREDCORRECTLY_FIELD_NAME = "free_mode_answered_correctly";
	public static final String NEWONDAY_FIELD_NAME = "new_on_day";
	// Datenbank Felder
	@DatabaseField(generatedId = true)
	private Integer id;
	@DatabaseField(columnName = FRONT_FIELD_NAME)
	private String front;
	@DatabaseField(columnName = BACK_FIELD_NAME)
	private String back;
	@DatabaseField(foreign = true, columnName = STACKID_FIELD_NAME)
	private Stack stack;
	@DatabaseField(columnName = CREATEDATE_FIELD_NAME)
	private Date create_date;
	@DatabaseField(columnName = REPEATDATE_FIELD_NAME)
	private Date repeatDate;
	@DatabaseField(columnName = NEWCARD_FIELD_NAME)
	private boolean newCard;
	@DatabaseField(columnName = INTERVALL_FIELD_NAME)
	private int intervall;
	@DatabaseField(columnName = FREEMODEANSWEREDCORRECTLY_FIELD_NAME)
	private boolean freeModeAnsweredCorrectly;
	@DatabaseField(columnName = NEWONDAY_FIELD_NAME)
	private Date newOnDay;

	// Getters & Setters
	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public String getFront()
	{
		return front;
	}

	public void setFront(String front)
	{
		this.front = front;
	}

	public String getBack()
	{
		return back;
	}

	public void setBack(String back)
	{
		this.back = back;
	}

	public Stack getStack()
	{
		return stack;
	}

	public void setStack(Stack stack)
	{
		this.stack = stack;
	}

	public Date getCreate_date()
	{
		return create_date;
	}

	public void setCreate_date(Date create_date)
	{
		this.create_date = create_date;
	}

	public Date getRepeatDate()
	{
		return repeatDate;
	}

	public void setRepeatDate(Date repeatDate)
	{
		this.repeatDate = repeatDate;
	}

	public boolean isNewCard()
	{
		return newCard;
	}

	public void setNewCard(boolean newCard)
	{
		this.newCard = newCard;
	}

	public int getIntervall()
	{
		return intervall;
	}

	public void setIntervall(int intervall)
	{
		this.intervall = intervall;
	}

	public boolean isFreeModeAnsweredCorrectly()
	{
		return freeModeAnsweredCorrectly;
	}

	public void setFreeModeAnsweredCorrectly(boolean freeModeAnsweredCorrectly)
	{
		this.freeModeAnsweredCorrectly = freeModeAnsweredCorrectly;
	}

	public Date getNewOnDay()
	{
		return newOnDay;
	}

	public void setNewOnDay(Date newOnDay)
	{
		this.newOnDay = newOnDay;
	}
}